<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>字典管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
	    	return false;
	    }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/bfAct/getList/">活动列表</a></li>
		<li><a href="${ctx}/bfAct/form">活动添加</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="actInfo" action="${ctx}/bfAct/getList/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<div>
			<label>ID：</label>
				<form:input path="id" htmlEscape="false" maxlength="50" class="input-medium"/>
			<label>活动名称：</label>
				<form:input path="actName" htmlEscape="false" maxlength="50" class="input-medium"/>
			<label>状态：</label>
			<form:select path="status" htmlEscape="false" maxlength="50" class="required">
			        <option value="">请选择</option>
					<form:options items="${fns:getDictList('activity_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select><br>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label>活动类型：</label>
			<form:select path="actType" htmlEscape="false" maxlength="50" class="required">
			        <option value="">--请选择--</option>
					<form:options items="${fns:getDictList('act_info_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			<label>活动创建日期：</label>
			<input id="createBTime" name="createBTime" type="text" readonly="readonly" maxlength="50" class="input-small Wdate sfm"
					 value="${actInfo.createBTime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>&nbsp;&nbsp;~&nbsp;&nbsp;
			<input id="createETime" name="createETime" type="text" readonly="readonly" maxlength="50" class="input-small Wdate sfm"
					 value="${actInfo.createETime}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			&nbsp;&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>&nbsp;&nbsp;
		</div>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead><tr><th>ID</th><th>活动名称</th><th>活动类型</th><th>活动起止时间</th><th>活动创建时间</th><th>状态</th><th>操作</th></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="act">
			<tr>
				<td>${act.id}</td>
				<td>${act.actName}</td>
				<td>${fns:getDictLabel(act.actType,'act_info_type','')}</td>
				<td><fmt:formatDate value='${act.startTime}' pattern="yyyy-MM-dd"/>至<fmt:formatDate value='${act.endTime}' pattern="yyyy-MM-dd"/></td>
				<td><fmt:formatDate value='${act.createTime}' pattern="yyyy-MM-dd"/></td>
				<td>${act.status eq '0'?'激活':'隐藏'}</td>
				<td>
				    <c:if test="${act.status!=0 }">
				    <a href="${ctx}/bfAct/form?id=${act.id}">修改</a>
				    </c:if>
				    <c:if test="${act.status==0 }">
				    <a href="${ctx}/bfAct/updStatus?id=${act.id}&status=1" onclick="return confirmx('确认要隐藏该活动吗？', this.href)">隐藏</a>
				    </c:if>
				    <c:if test="${act.status!=0 }">
				    <a href="${ctx}/bfAct/updStatus?id=${act.id}&status=0" onclick="return confirmx('确认要激活该活动吗？', this.href)">激活</a>
				    </c:if>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>